import request from '@/config/axios'

export interface UserVO {
  id: number
  username: string
  nickname: string
  deptId: number
  postIds: string[]
  email: string
  mobile: string
  sex: number
  avatar: string
  loginIp: string
  status: number
  remark: string
  loginDate: Date
  createTime: Date
}

// 商务查询列表
export const getBusinessPage = (params: PageParam) => {
  return request.get({ url: '/quoteManage/formList', params })
}

// 获取测试类型列表
export const getOrderContent = () => {
  return request.get({ url: '/financeConfirmManage/getServices' })
}

// 编辑报价
export const editQuoteInfo = async (data) => {
  return await request.post({
    headersType: 'multipart/form-data',
    url: '/quoteManage/editQuoteInfo',
    data
  })
}

// 商务查询列表
export const getFinancePage = (params: PageParam) => {
  return request.get({ url: '/financeConfirmManage/formList', params })
}

// 确认回款
export const editFinanceConfirmInfo = (data) => {
  return request.post({
    url: '/financeConfirmManage/editFinanceConfirmInfo',
    data
  })
}

// 测评查询列表
export const getTestPage = (params: PageParam) => {
  return request.get({ url: '/testDeliverManage/formList', params })
}

// 项目负责人查询
export const getProjectManagers = (params) => {
  return request.get({ url: '/testDeliverManage/getProjectManagers', params })
}

// 测评交付
export const editTestDeliverInfo = async (data) => {
  return await request.post({
    headersType: 'multipart/form-data',
    url: '/testDeliverManage/editTestDeliverInfo',
    data
  })
}

// 查询订单详情
export const getOrderId = (id: number) => {
  return request.get({ url: '/testDeliverManage/getAllCommercialInfoByOrderId?orderId=' + id })
}

// 关闭订单
export const deleteOrder = (params) => {
  return request.get({ url: '/orderManage/deleteOrder', params })
}

// 我的订单
export const getOrderList = (params) => {
  return request.get({ url: '/orderManage/formList', params })
}
// 支付订单
export const payOrder = (params) => {
  return request.get({ url: '/member/pay/updateOrderStatus', params })
}
// 获取订单详情
export const getOrderDetail = (params) => {
  return request.get({ url: '/testDeliverManage/getAllCommercialInfoByOrderId', params })
}
// 确认订单
export const orderConfirm = (params) => {
  return request.get({ url: '/member/confirmOrder', params })
}
// 申请售后
export const applyForAfterSales = (params) => {
  return request.get({ url: '/member/applyForAfterSales', params })
}
